package com.hp.TrimClient;

import java.text.SimpleDateFormat;
import java.util.Date;

public class TrimDateTime implements TrimProperty {
	
	private Boolean IsClear;
	private Boolean IsTimeClear;
	private Date DateTime;
	private String StringValue;

	
	public TrimDateTime() {

	}
	
	public TrimDateTime(Date date ) {
		DateTime = date;
		
		IsClear = date == null;
		
		IsTimeClear = date == null;
	}
	
	public TrimDateTime(Date date, Boolean isClear, Boolean isTimeClear ) {
		DateTime = date;
		
		IsClear = isClear;
		IsTimeClear = isTimeClear;
	}
	
	
	public Date getDateTime() {
		return DateTime;
	}
	
	public void setDateTime(Date dateTime) {
		DateTime = dateTime;
	}

	@Override
	public String getStringValue() {		
		return StringValue;
	}

	@Override
	public void setStringValue(String stringValue) {
		this.StringValue = stringValue;
		
	}


	public Boolean getIsClear() {
		return IsClear;
	}


	public void setIsClear(Boolean isClear) {
		IsClear = isClear;
	}


	public Boolean getIsTimeClear() {
		return IsTimeClear;
	}


	public void setIsTimeClear(Boolean isTimeClear) {
		IsTimeClear = isTimeClear;
	}

	@Override
	public Class<?> getTrimClass() {
		// TODO Auto-generated method stub
		return this.getClass();
	}
	
	@Override
	public String toString() {
		if (DateTime != null) {
			SimpleDateFormat formatter= new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.s");				 
			return formatter.format(DateTime);
		} else {
			return super.toString();
		}		
	}
}
